
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The impact of divorce laws on the equilibrium in the marriage market.
% Reynoso
% April 2024
%
% This file estimates the model under mutual consent divorce.
%  
% Data: PSID 1968-1992
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%------------------------ Replication Path -------------------------------%

clc
clear all

%--- Indicate location of Replication folder:
%replication_location = 'C:\update_with_your_path';

%------------------------ Preliminaries ----------------------------------%

%--- Working directory
cd ([replication_location,'\Internal_estimation']);

%--- Path for storing
output_dir = [replication_location,'\Outputs'];

%--- Path for Model
addpath(genpath([replication_location,'\Internal_estimation\Inputs']));

load ('Inputs/inputs_mcd.mat');

%------------------------ Estimation routine -----------------------------%

rng default % for reproducibility
[X,fval,exitflag,output] = fminsearch(problem);

save(fullfile(output_dir,'\MCD\outputs_mcd.mat'));
